
xcoords = open('x-coords.csv').read().split(',')
ycoords = open('y-coords.csv').read().split(',')
outfile = open('grid.csv', 'w')

for x in xcoords:
    for y in ycoords:
        outfile.write(x.strip() + ',' + y.strip() + '\n')

outfile.close()
